{\rtf1\ansi\deff0\adeflang1025
{\fonttbl{\f0\froman\fprq2\fcharset0 Times New Roman;}{\f1\froman\fprq2\fcharset0 Times New Roman;}{\f2\fswiss\fprq2\fcharset0 Arial;}{\f3\froman\fprq2\fcharset0 Times New Roman;}{\f4\fmodern\fprq1\fcharset0 Courier New;}{\f5\fswiss\fprq2\fcharset128 Microsoft Sans Serif;}{\f6\fswiss\fprq2\fcharset0 Arial Unicode MS;}{\f7\fnil\fprq2\fcharset0 MS Mincho;}{\f8\fnil\fprq0\fcharset0 Tahoma;}}
{\colortbl;\red0\green0\blue0;\red128\green128\blue128;}
{\stylesheet{\s1\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\fs24\lang1033\loch\fs24\lang1033\snext1 Normal;}
{\s2\sb240\sa120\keepn\rtlch\af2\afs28\lang255\ltrch\dbch\af7\langfe255\hich\f2\fs28\lang1033\loch\f2\fs28\lang1033\sbasedon1\snext3 Heading;}
{\s3\sa120\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\fs24\lang1033\loch\fs24\lang1033\sbasedon1\snext3 Body Text;}
{\s4\sa120\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\fs24\lang1033\loch\fs24\lang1033\sbasedon3\snext4 List;}
{\s5\sb120\sa120\rtlch\af8\afs24\lang255\ai\ltrch\dbch\af6\langfe255\hich\fs24\lang1033\i\loch\fs24\lang1033\i\sbasedon1\snext5 caption;}
{\s6\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\fs24\lang1033\loch\fs24\lang1033\sbasedon1\snext6 Index;}
{\s7\sb120\sa120\rtlch\afs24\lang255\ai\ltrch\dbch\af6\langfe255\hich\fs24\lang1033\i\loch\fs24\lang1033\i\sbasedon1\snext7 caption;}
{\s8\rtlch\af4\afs20\lang255\ltrch\dbch\af4\langfe255\hich\f4\fs20\lang1033\loch\f4\fs20\lang1033\sbasedon1\snext8 Preformatted Text;}
}
{\info{\creatim\yr2011\mo7\dy19\hr6\min24}{\revtim\yr0\mo0\dy0\hr0\min0}{\printim\yr0\mo0\dy0\hr0\min0}{\comment StarWriter}{\vern3000}}\deftab709
{\*\pgdsctbl
{\pgdsc0\pgdscuse195\pgwsxn12240\pghsxn15840\marglsxn1134\margrsxn1134\margtsxn1134\margbsxn1134\pgdscnxt0 Standard;}}
{\*\pgdscno0}\paperh15840\paperw12240\margl1134\margr1134\margt1134\margb1134\sectd\sbknone\pgwsxn12240\pghsxn15840\marglsxn1134\margrsxn1134\margtsxn1134\margbsxn1134\ftnbj\ftnstart1\ftnrstcont\ftnnar\aenddoc\aftnrstcont\aftnstart1\aftnnrlc
\pard\plain \ltrpar\s1\ql\rtlch\af5\afs20\lang255\ltrch\dbch\af6\langfe255\hich\f5\fs20\lang1033\loch\f5\fs20\lang1033 {\rtlch \ltrch\loch\f5\fs20\lang1033\i0\b0 using Tesla.Bounding;}
\par \pard\plain \ltrpar\s1\ql\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\f5\fs20\lang1033\loch\f5\fs20\lang1033 {\rtlch \ltrch\loch\f5\fs20\lang1033\i0\b0 using Tesla.Core;}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch\f5\fs20\lang1033\i0\b0 using Tesla.Input;}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch\f5\fs20\lang1033\i0\b0 using Tesla.Math;}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch\f5\fs20\lang1033\i0\b0 using Tesla.Scene;}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch\f5\fs20\lang1033\i0\b0 using Tesla.Scene.Shape;}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch\f5\fs20\lang1033\i0\b0 using Tesla.Content;}
\par \pard\plain \ltrpar\s1\ql\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 
\par \pard\plain \ltrpar\s1\ql\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\f5\fs20\lang1033\loch\f5\fs20\lang1033 {\rtlch \ltrch\loch\f5\fs20\lang1033\i0\b0 namespace TeslaSamples.Misc \{}
\par \pard\plain \ltrpar\s1\ql\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch     }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f5\fs20\loch\f5\fs20 [AppDescription("Input Handling", PlatformCapabilities.Direct3D10 | PlatformCapabilities.XNA4, "UserInputImage", "UserInputDesc", "UserInputSource")]}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch     }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f5\fs20\loch\f5\fs20 public class UserInput : BasicApp \{}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch         }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f5\fs20\loch\f5\fs20 private float rotateSpeed;}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch         }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f5\fs20\loch\f5\fs20 private float speed;}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch         }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f5\fs20\loch\f5\fs20 private InputLayer input;}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch         }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f5\fs20\loch\f5\fs20 protected override void LoadContent() \{}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f5\fs20\loch\f5\fs20 Window.Title = "Input Handling - Use the arrow keys to move the object about.";}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f5\fs20\loch\f5\fs20 rotateSpeed = 2.5f;}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f5\fs20\loch\f5\fs20 speed = 105.0f;}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f5\fs20\loch\f5\fs20 Renderer.CurrentCamera.Position = new Vector3(0, 800, 100);}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f5\fs20\loch\f5\fs20 Renderer.CurrentCamera.LookAt(Vector3.Zero, Vector3.Up);}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f5\fs20\loch\f5\fs20 Renderer.CurrentCamera.Update();}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f5\fs20\loch\f5\fs20 //Load our fancy pants racecar }
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f5\fs20\loch\f5\fs20 ModelLoaderParameters mlp = new ModelLoaderParameters();}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f5\fs20\loch\f5\fs20 mlp.SwapWindingOrder = true;}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f5\fs20\loch\f5\fs20 mlp.NormalGeneration = NormalGeneration.Crease;}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f5\fs20\loch\f5\fs20 mlp.PreferLitMaterials = true;}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f5\fs20\loch\f5\fs20 Spatial car = ContentManager.Load<Spatial>("Models//Jeep.dxs", mlp);}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f5\fs20\loch\f5\fs20 car.SetModelBound(new BoundingBox());}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f5\fs20\loch\f5\fs20 RootNode.AddChild(car);}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f5\fs20\loch\f5\fs20 //Create an input layer, this layer will hold all of our controls and input response to the arrow keys, moving the car}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f5\fs20\loch\f5\fs20 input = new InputLayer();}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f5\fs20\loch\f5\fs20 //Input layers can be disabled or enabled, so you're able to logically group your inputs together and treat them as one unit.}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f5\fs20\loch\f5\fs20 //E.g. if you have a screen menu and want the mouse enabled, but for gameplay do not want the mouse enabled.}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f5\fs20\loch\f5\fs20 //Rather than disabling the whole layer, we'll just disable the first 5 triggers - which are the}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f5\fs20\loch\f5\fs20 //FPS controls set in BasicApp.}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f5\fs20\loch\f5\fs20 InputLayer.EnableTrigger(0, false);}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f5\fs20\loch\f5\fs20 InputLayer.EnableTrigger(1, false);}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f5\fs20\loch\f5\fs20 InputLayer.EnableTrigger(2, false);}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f5\fs20\loch\f5\fs20 InputLayer.EnableTrigger(3, false);}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f5\fs20\loch\f5\fs20 InputLayer.EnableTrigger(4, false);}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f5\fs20\loch\f5\fs20 //Since we disabled the basicApp's input alyer, lets make sure we can get out of the app}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f5\fs20\loch\f5\fs20 input.RegisterTrigger(new InputTrigger(new KeyPressedCondition(Keys.Escape, false),}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch                 }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f5\fs20\loch\f5\fs20 new InputAction(delegate(GameTime time) \{}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch                     }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f5\fs20\loch\f5\fs20 Exit();}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch                 }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f5\fs20\loch\f5\fs20 \})));}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f5\fs20\loch\f5\fs20 input.RegisterTrigger(new InputTrigger(new KeyPressedCondition(Keys.A, true), new InputAction(}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch                 }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f5\fs20\loch\f5\fs20 delegate(GameTime time) \{}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch                     }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f5\fs20\loch\f5\fs20 car.Rotation *= Quaternion.FromAngleAxis(rotateSpeed * (float)time.ElapsedTimeInSeconds, Vector3.Up);}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch                 }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f5\fs20\loch\f5\fs20 \}}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f5\fs20\loch\f5\fs20 )));}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f5\fs20\loch\f5\fs20 input.RegisterTrigger(new InputTrigger(new KeyPressedCondition(Keys.D, true), new InputAction(}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch                 }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f5\fs20\loch\f5\fs20 delegate(GameTime time) \{}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch                     }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f5\fs20\loch\f5\fs20 car.Rotation *= Quaternion.FromAngleAxis(-rotateSpeed * (float) time.ElapsedTimeInSeconds, Vector3.Up);}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch                 }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f5\fs20\loch\f5\fs20 \}}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f5\fs20\loch\f5\fs20 )));}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f5\fs20\loch\f5\fs20 input.RegisterTrigger(new InputTrigger(new KeyPressedCondition(Keys.W, true), new InputAction(}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch                 }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f5\fs20\loch\f5\fs20 delegate(GameTime time) \{}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch                     }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f5\fs20\loch\f5\fs20 //Usually a good idea to use the world properties, since this may be attached to a node that is moving also}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch                     }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f5\fs20\loch\f5\fs20 car.Translation -= car.WorldTransform.GetRotationVector(2) * speed * (float) time.ElapsedTimeInSeconds;}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch                 }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f5\fs20\loch\f5\fs20 \}}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f5\fs20\loch\f5\fs20 )));}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f5\fs20\loch\f5\fs20 input.RegisterTrigger(new InputTrigger(new KeyPressedCondition(Keys.S, true), new InputAction(}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch                 }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f5\fs20\loch\f5\fs20 delegate(GameTime time) \{}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch                     }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f5\fs20\loch\f5\fs20 car.Translation += car.WorldTransform.GetRotationVector(2) * speed * (float) time.ElapsedTimeInSeconds;}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch                 }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f5\fs20\loch\f5\fs20 \}}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f5\fs20\loch\f5\fs20 )));}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f5\fs20\loch\f5\fs20 //Add another point light to the scene}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f5\fs20\loch\f5\fs20 PointLight pl = new PointLight();}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f5\fs20\loch\f5\fs20 pl.Attenuate = false;}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f5\fs20\loch\f5\fs20 pl.Position = new Vector3(0, 0, 50);}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f5\fs20\loch\f5\fs20 car.AddLight(pl);}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch         }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f5\fs20\loch\f5\fs20 \}}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch         }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f5\fs20\loch\f5\fs20 //During the update process, we check the triggers and process any input. Typically}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch         }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f5\fs20\loch\f5\fs20 //this is done before updating the geometric state of your objects (e.g. calle Spatial.Update()),}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch         }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f5\fs20\loch\f5\fs20 //since your input may change that state.}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch         }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f5\fs20\loch\f5\fs20 protected override void OnUpdate(GameTime time) \{}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch             }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f5\fs20\loch\f5\fs20 input.CheckTriggers(time);}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch         }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f5\fs20\loch\f5\fs20 \}}
\par \pard\plain \ltrpar\s1\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\fs24\lang1033\loch\fs24\lang1033 {\rtlch \ltrch\loch     }{\rtlch \ltrch\loch\f0\fs24\lang1033\i0\b0\ltrch\hich\f5\fs20\loch\f5\fs20 \}}
\par \pard\plain \ltrpar\s1\ql\rtlch\afs24\lang255\ltrch\dbch\af6\langfe255\hich\f5\fs20\lang1033\loch\f5\fs20\lang1033 {\rtlch \ltrch\loch\f5\fs20\lang1033\i0\b0 \}}
\par }